﻿using Sustainalytics.ClientDW.Synchronization.SyncReferenceUniv.ReferenceUniverseLogic;

using System.Diagnostics;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Sustainalytics.ClientDW.Synchronization.SyncReferenceUniv.Tests
{
    public class ReferenceUniverseSyncTests : ReferenceUniverseBaseTests
    {
        private readonly ReferenceUniverseOrchestrator referenceUniverseOrchestrator;

        public ReferenceUniverseSyncTests(ITestOutputHelper output) : base(output)
        {
            referenceUniverseOrchestrator = SimpleInjectorContainer.GetInstance<ReferenceUniverseOrchestrator>();
        }

        [Fact]
        public async Task StartAsync()
        {
            var stopWatch = Stopwatch.StartNew();
            Log($" {nameof(ReferenceUniverseSyncTests)} started");

            await referenceUniverseOrchestrator.OrchestrateAsync();

            stopWatch.Stop();
            var elapsed = stopWatch.Elapsed.Seconds;
            Log($"Duration {elapsed.ToString()} seconds");
        }
    }
}
